package com.ruoyi.project.device.executionCheck.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.project.mydo.mydojob.domain.MydoJob;
import com.ruoyi.project.mydo.mydojob.service.IMydoJobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/device/executionCheck")
public class ExecutionCheckController {
    private String prefix="device/executionCheck";
    @Autowired
    IMydoJobService mydoJobService;

    @GetMapping("")
    public String exetion()
    {
        return prefix+"/executionCheck";
    }


    @RequestMapping("/update")
    @ResponseBody
    public AjaxResult update(MydoJob mydoJob){
        int i = mydoJobService.updateMydoJob(mydoJob);
        if(i>0){
            return AjaxResult.success();
        }else{
            return AjaxResult.error();
        }

    }
}
